<template>
	<view>
		<u-list @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in noticelist" :key="index">
				<view class="wrapper mb30 borRadius14 margin30" @click="handleClick(item)">

					<view>
						<view class='   acea-row row-between-wrapper'>

							<text class='Area'>{{item.studentArea}}</text>

							<text class='money font-color'>￥{{item.price}}</text>
						</view>

					</view>
					<view>
						<view class='Describefather   acea-row row-between-wrapper '>

							<text class='Describe'>{{item.studentDescribe}}</text>


						</view>

					</view>
					<view>
						<view class='label acea-row row-between-wrapper top30'>
							<view style="margin-left: 10rpx;">学员年级:{{item.studentGrade ||"暂无"}}</view>
							<view>家教科目:{{item.studentParentingSubjects ||"暂无"}} </view>
							<view>
								授课方式:{{item.studentTeachingMethod || "暂无"}}
							</view>
						</view>
					</view>
					<view>
						<view class='label acea-row   address'>
							<u-icon name="map-fill" size="14"></u-icon>
							<view>学员地址:{{item.studentAddress || "暂无"}}</view>

						</view>
					</view>
					<view>
						<view class='label acea-row   address'>
							<u-icon name="tags-fill" size="14"></u-icon>
							<view>发布时间:{{item.remark1 ||"暂无"}}</view>

						</view>
					</view>
				</view>
			</u-list-item>
		</u-list>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				// adlist:this.myad()[0],
				noticelist: [],
				editFormFields: {
					pageNum: 1,
					pageSize: 10
				},
				total: 0,
			}
		},
		onLoad() {
			this.getNoticelist()
		},
		onPullDownRefresh() {
			console.log('refresh');
			// setTimeout(function () {
			// 	uni.stopPullDownRefresh();
			// }, 1000);
			this.noticelist= [],
			this.pageNum = 1;
			this.getNoticelist();
		},
		methods: {
			handleClick(item) {
			 console.log(item.id)
				uni.navigateTo({
					url: '/pages/dz_student/dz_student_details?id=' +item.id

				});
			},
			scrolltolower() {
				// console.log("111")

				console.log(this.editFormFields.pageNum)
				if (this.total > this.editFormFields.pageNum * this.editFormFields.pageSize) {
				this.editFormFields.pageNum++;
					   console.log("请求数据")
					this.getNoticelist();
				}

			},

			getNoticelist() {
				let that = this
				this.http.get("wechat/student/list", this.editFormFields, "正在递交数据....").then(data => {
					uni.stopPullDownRefresh();
					if (data.code == 200) {
						var noticelist = this.noticelist;
						
						data.rows.forEach(function(item) {
							noticelist.push(item);
						})
						this.noticelist = noticelist;
						this.total = data.total;
					} else {
						this.$toast(data.msg)
					}
				})
				// that.request('loadNotice','GET').then(res =>{
				// 	console.log(res)
				// 	if(res){
				// 		this.noticelist = res.data
				// 	}
				// })
			}
		}
	}
</script>

<style lang="less" scoped>
	.type_text {
		color: red
	}


	.label {
		// margin-bottom: 40rpx;
		font-size: 24rpx;
		color: #82848f;
	}

	.money {
		font-size: 38rpx;
		font-weight: 700
	}

	.Area {
		font-size: 38rpx;
		font-weight: 400;
		color: #55aaff;
	}

	.Describefather {
		height: 100%;
		// margin-right: 130rpx;
		margin-top: 30rpx;
		padding: 10rpx;
	}

	.Describe {

		font-size: 32rpx;
		// font-weight: 700;
		width: 100%;
		overflow-wrap: break-word;
		line-height: 52rpx;
		// margin: 16rpx 16rpx 26rpx 0;

	}

	.wrapper {
		background-color: #fff;
		padding: 30rpx 24rpx;
		margin-top: 30rpx;
	}

	.margin30 {
		margin-top: 10rpx;
		margin-left: 30rpx;
		margin-right: 30rpx;
	}

	.address {
		margin-top: 30rpx;
	}

	.top30 {
		margin-top: 30rpx;
	}
</style>
